package com.pearadmin.hospital.service.impl;

import java.util.List;
import java.util.ArrayList;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.pearadmin.common.web.domain.request.PageDomain;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.pearadmin.hospital.mapper.HospitalOwinfoMapper;
import com.pearadmin.hospital.domain.HospitalOwinfo;
import com.pearadmin.hospital.service.IHospitalOwinfoService;

/**
 * 出入库Service业务层处理
 * 
 * @author yuan
 * @date 2021-07-29
 */
@Service
public class HospitalOwinfoServiceImpl implements IHospitalOwinfoService 
{
    @Autowired
    private HospitalOwinfoMapper hospitalOwinfoMapper;

    /**
     * 查询出入库
     * 
     * @param id 出入库ID
     * @return 出入库
     */
    @Override
    public HospitalOwinfo selectHospitalOwinfoById(Integer id)
    {
        return hospitalOwinfoMapper.selectHospitalOwinfoById(id);
    }

    /**
     * 查询出入库列表
     * 
     * @param hospitalOwinfo 出入库
     * @return 出入库
     */
    @Override
    public List<HospitalOwinfo> selectHospitalOwinfoList(HospitalOwinfo hospitalOwinfo)
    {
        return hospitalOwinfoMapper.selectHospitalOwinfoList(hospitalOwinfo);
    }

    /**
     * 查询出入库
     * @param hospitalOwinfo 出入库
     * @param pageDomain
     * @return 出入库 分页集合
     * */
    @Override
    public PageInfo<HospitalOwinfo> selectHospitalOwinfoPage(HospitalOwinfo hospitalOwinfo, PageDomain pageDomain)
    {
        PageHelper.startPage(pageDomain.getPage(),pageDomain.getLimit());
        List<HospitalOwinfo> data = hospitalOwinfoMapper.selectHospitalOwinfoList(hospitalOwinfo);
        return new PageInfo<>(data);
    }

    /**
     * 新增出入库
     * 
     * @param hospitalOwinfo 出入库
     * @return 结果
     */

    @Override
    public int insertHospitalOwinfo(HospitalOwinfo hospitalOwinfo)
    {
        return hospitalOwinfoMapper.insertHospitalOwinfo(hospitalOwinfo);
    }

    /**
     * 修改出入库
     * 
     * @param hospitalOwinfo 出入库
     * @return 结果
     */
    @Override
    public int updateHospitalOwinfo(HospitalOwinfo hospitalOwinfo)
    {
        return hospitalOwinfoMapper.updateHospitalOwinfo(hospitalOwinfo);
    }

    /**
     * 删除出入库对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteHospitalOwinfoByIds(String[] ids)
    {
        return hospitalOwinfoMapper.deleteHospitalOwinfoByIds(ids);
    }

    /**
     * 删除出入库信息
     * 
     * @param id 出入库ID
     * @return 结果
     */
    @Override
    public int deleteHospitalOwinfoById(Integer id)
    {
        return hospitalOwinfoMapper.deleteHospitalOwinfoById(id);
    }
}
